
<script src="<?php echo yii::app()->theme->baseUrl;  ?>/assets/js/indicentercollect.js"></script>
	<div class="indi-center-bg">
		<div class="indi-center">
			<div class="indi-center-box">
				<h2>个人中心</h2>
				<div class="indi-center-content clearfix">

					<?php include $this->getViewFile('//layouts/user/left') ?>

					<div class="indi-center-con-r">
						<div class="indi-center-con-r-top">
							<span>我的收藏</span>
						</div>
						<div class="indi-center-con-r-middle">
							<table class="indi-center-collect-table">
								<tr>
									<td style="width: 422px">宝贝名称</td>
									<td style="width:106px">价格</td>
									<td style="width:106px">状态</td>
									<td style="width:106px">开始时间</td>
								</tr>
							</table>
						</div>
						<div class="indi-center-collect">
							<div class="indi-center-choose">
								<?php foreach($data['data'] as $goodID => $rs){  ?>
								<?php  $goodsData = GoodsModel::getOne($goodID); ?>
								<div data-goodsID="<?php echo $goodID; ?>"  data-userID="<?php echo $rs['UserID']; ?>" class="clearfix indi-center-ch indi-center-ch-collect">
									<label for="choose" class="indiChoose"></label>
									<div class="indi-center-cb">
										<input type="checkbox" name="id" value="<?php echo $goodID; ?>" id="choose" >
									</div>
									<dl class="clearfix">
										<dt>
											<a target="_blank" href="<?php echo $this->createUrl('/front/goods/detail', array('gid' => $goodID)) ?>"><img style="width:100px;height:100px" src="<?php echo $goodsData['Image']; ?>" alt=""></a>
										</dt>
										<dd>
											<table class="indi-center-ch-collect-table">
												<tr>
													<td style="width: 300px">
														<a href="" class="indi-center-collect-font"><?php echo $goodsData['GoodsName']; ?></a>
													</td>
													<td style="width: 97px">￥<?php  echo $goodsData['Pprice'];?></td>
													<td style="width:110px"><a target="_blank" href="<?php echo $this->createUrl('/front/goods/detail', array('gid' => $goodID)) ?>">去抢购</a></td>
													<td style="width:158px"><?php echo date('Y-m-d H:i:s', $rs['AddTime']); ?></td>
												</tr>
											</table>
										</dd>
									</dl>
								</div>
								<?php } ?>


								<?php  
									if(!empty($data['page'])){
		                                $this->widget('CLinkPager', array(
		                                    'header' => "",
		                                    'firstPageLabel' => '首页',
		                                    'lastPageLabel' => '末页',
		                                    'prevPageLabel' => '上一页',
		                                    'nextPageLabel' => '下一页',
		                                    'pages' => $data['page'],
		                                    'footer' => "<span>共<em>{$data['page']->pageCount}</em>页</span>",
		                                    'maxButtonCount' => 10
		                                        )
		                                );										
									}



								 ?>


							</div>
						</div>
						<div class="indi-center-con-r-middle">
							<input type="checkbox" class="chooseAll">
							<label for="">全选</label>
							<span class="indi-center-delete">删除</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<script src="<?php echo yii::app()->theme->baseUrl;  ?>/assets/statics/js/ajaxForm.js"></script> 
<link rel="stylesheet" href="<?php echo yii::app()->theme->baseUrl;  ?>/assets/statics/js/artDialog6/css/ui-dialog.css">
<script src="<?php echo yii::app()->theme->baseUrl;  ?>/assets/statics/js/artDialog6/js/dialog-min.js"></script> 


<script type="text/javascript">
	var LOCK = false;


	$(function(){
		$(".indi-center-delete").click(function(){
			tips = dialog({
				fixed: true,
				cancelDisplay: false
			});					
			if(LOCK){
				tips.title('还有正在提交的');
				tips.showModal();
				return false;
			}else{
				LOCK = true;
				tips.title('正在提交');
			}
			var data = [];
			var obj = $("input[name='id']:checked");
			length = obj.length;

			for(var i=0;i<length;i++){
				data[i] = obj.eq(i).val();
			}
			$.post('<?php echo $this->createUrl("deleteList") ?>',{id:data},function(data){
				LOCK = false;
				if(data.status){
					tips.title('提交成功');
					window.location.reload();
				}else{
					tips.title('提交失败');
					tips.content(data.info);
				}				
			},'json');
					
		})
	})

</script>

